home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2001 Haziran / CHIP Haziran2001.iso / prog / share / 16 / setup.exe / %AppDir% / Dmb.chm / menu.js < prev    next >
Encoding:
JavaScript  |  2001-04-24  |  22.5 KB  |  659 lines

  1. ////////////////////////////////////////////////
  2. //  DHTML MENU BUILDER 2.8.7                  //
  3. //  (c)xFX JumpStart                          //
  4. //                                            //
  5. //  PSN: 7294-239428-XFX-4502                 //
  6. //                                            //
  7. //  GENERATED: 2/8/2001 - 6:25:00 PM          //
  8. ////////////////////////////////////////////////
  9.  
  10.  
  11.     var nStyle = new Array;
  12.     var hStyle = new Array;
  13.     var nLayer = new Array;
  14.     var hLayer = new Array;
  15.     var nTCode = new Array;
  16.  
  17.     var AnimStep = 0;
  18.     var AnimHnd = 0;
  19.     var HTHnd = new Array;
  20.     var DoFormsTweak = true;
  21.  
  22.     var mFrame;
  23.     var cFrame;
  24.  
  25.     var OpenMenus = new Array;
  26.     var SelCommand;
  27.     var nOM = 0;
  28.  
  29.     var mX;
  30.     var mY;
  31.     var xOff = 0;
  32.  
  33.     var HideSpeed = 300;
  34.  
  35. var BV=navigator.appVersion;
  36. BV=parseFloat(BV.indexOf('MSIE')>0?BV.split(';')[1].split(' ')[2]:BV.split(' ')[0]);
  37. var BN=window.navigator.appName;
  38. var IsWin=(navigator.userAgent.indexOf('Windows')!=-1)?true:false;
  39. var OP=(navigator.userAgent.indexOf('Opera')!=-1&&BV>=4)?true:false;
  40. var SM=(BN.indexOf('Netscape')!=-1&&(BV>=5)||OP)?true:false;
  41. var NS=(BN.indexOf('Netscape')!=-1&&!SM)?true:false;
  42. var IE=(BN.indexOf('Explorer')!=-1&&(BV>=4)||SM)?true:false;
  43.  
  44.  
  45.     if((!IsWin&&IE)||SM) {
  46.         frames.self = window;
  47.         frames.top = top;
  48.     }
  49.  
  50.     if(IE)
  51.         xOff = (SM&&!OP)?-9:2;
  52.     cFrame = eval(frames['self']);
  53.  
  54.     var fx = 0;
  55.  
  56.  
  57.  
  58.     hStyle[0]="border: 1px;  font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #000000; background-color: #FFFFFF; cursor: hand;";
  59.     hStyle[1]="border: 1px;  font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #000000; background-color: #FFFFFF; cursor: hand;";
  60.     hStyle[2]="border: 1px;  font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #000000; background-color: #FFFFFF; cursor: hand;";
  61.     nTCode[1]="frames[\'self\'].execURL(\'http://www.yahoo.com/\', \'frames[self]\');";
  62.     nLayer[1]="<p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Yahoo</font></b>";
  63.     hLayer[1]="<p align=left><b><font face=Tahoma point-size=8 color=#000000>Yahoo</font></b>";
  64.     nLayer[2]="";
  65.     hLayer[2]="";
  66.     nTCode[3]="frames[\'self\'].execURL(\'index.html\', \'frames[self]\');";
  67.     nLayer[3]="<p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Home Page</font></b>";
  68.     hLayer[3]="<p align=left><b><font face=Tahoma point-size=8 color=#000000>Home Page</font></b>";
  69.     nTCode[4]="frames[\'self\'].execURL(\'mailto:prgsupport@xfx.net\', \'frames[self]\');";
  70.     nLayer[4]="<p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Email Me</font></b>";
  71.     hLayer[4]="<p align=left><b><font face=Tahoma point-size=8 color=#000000>Email Me</font></b>";
  72.  
  73.  
  74.     function GetCurCmd(e) {
  75. //IE
  76. //This function will return the current command under the mouse pointer.
  77. //It will return null if the mouse is not over any command.
  78. //------------------------------
  79. //Version 1.5
  80. //
  81.         if(SM)
  82.             var cc = e;
  83.         else
  84.             var cc = mFrame.window.event.srcElement;
  85.         while(cc.id=="") {
  86.             cc = cc.parentElement;
  87.             if(cc==null)
  88.                 break;
  89.         }
  90.         return cc;
  91.     }
  92.  
  93.     function HoverSel(mode, imgLName, imgRName, e) {
  94. //IE
  95. //This is the function called every time the mouse pointer is moved over a command.
  96. //------------------------------
  97. //mode: 0 if the mouse is moving over the command and 1 if is moving away.
  98. //imgLName: Name of the left image object, if any.
  99. //imgRName: Name of the right image object, if any.
  100. //------------------------------
  101. //Version 10.0
  102. //
  103.         var imgL = new Image;
  104.         var imgLRsc = new Image;
  105.         var imgR = new Image;
  106.         var imgRRsc = new Image;
  107.         var nStyle;
  108.         var mc;
  109.         
  110.         if(mode==0 && OpenMenus[nOM].SelCommand!=null)
  111.             HoverSel(1);
  112.         
  113.         if(imgLName!="_")
  114.             var imgL = eval("mFrame.document.images['"+imgLName+"']");
  115.         if(imgRName!="_")
  116.             var imgR = eval("mFrame.document.images['"+imgRName+"']");
  117.         
  118.         if(mode==0) {
  119.             mc = GetCurCmd(e);
  120.             if(nOM>1)
  121.                 if(mc==OpenMenus[nOM-1].SelCommand)
  122.                     return false;
  123.             if(OpenMenus[nOM].SelCommand || nOM>1)
  124.                 while(!InMenu()&&nOM>1)
  125.                     Hide();
  126.             if(imgLName!='_') imgLRsc = eval(imgLName+"On");
  127.             if(imgRName!='_') imgRRsc = eval(imgRName+"On");
  128.             OpenMenus[nOM].SelCommand = mc;
  129.             OpenMenus[nOM].SelCommandPar = [imgLName,imgRName,SM?mc.getAttribute("style"):mc.style.cssText];
  130.             if(SM)
  131.                 mc.setAttribute("style", GetCStyle(mc.style) + hStyle[mc.id]);
  132.             else
  133.                 mc.style.cssText = GetCStyle(mc.style) + hStyle[mc.id];
  134.         } else {
  135.             mc = (mode==1)?OpenMenus[nOM].SelCommand:OpenMenus[nOM].Opener;
  136.             imgLName = (mode==1)?OpenMenus[nOM].SelCommandPar[0]:OpenMenus[nOM].OpenerPar[0];
  137.             imgRName = (mode==1)?OpenMenus[nOM].SelCommandPar[1]:OpenMenus[nOM].OpenerPar[1];
  138.             nStyle = (mode==1)?OpenMenus[nOM].SelCommandPar[2]:OpenMenus[nOM].OpenerPar[2];
  139.             mc.style.background = "";
  140.             if(SM)
  141.                 mc.setAttribute("style", nStyle);
  142.             else
  143.                 mc.style.cssText = nStyle;
  144.             if(imgLName!='_') imgLRsc = eval(imgLName+"Off");
  145.             if(imgRName!='_') imgRRsc = eval(imgRName+"Off");
  146.             window.status = "";
  147.             OpenMenus[nOM].SelCommand = null;            
  148.         }
  149.         
  150.         if(imgLName!='_') {
  151.             imgL = eval("mFrame.document.images."+imgLName);
  152.             imgL.src = imgLRsc.src;
  153.         }
  154.         if(imgRName!='_') {
  155.             imgR = eval("mFrame.document.images."+imgRName);
  156.             imgR.src = imgRRsc.src;
  157.         }
  158.         
  159.         return true;
  160.     }
  161.  
  162.     function NSHoverSel(mode, mc, bcolor) {
  163. //NS
  164. //This is the function called every time the mouse pointer is moved over or away from a command.
  165. //------------------------------
  166. //mode: 0 if the mouse is moving over the command and 1 if is moving away.
  167. //mc: Name of the layer that corresponds to the selected command.
  168. //n: Unique ID that identifies this command. Used to retrieve the data from the nLayer or hLayer array.
  169. //bcolor: Background color of the command. Ignored if the group uses a background image.
  170. //w: Width of the command's layer.
  171. //h: Height of the command's layer.
  172. //------------------------------
  173. //Version 11.0
  174. //
  175.         var n;
  176.         var LayerHTM;
  177.         if(mode==0 && OpenMenus[nOM].SelCommand!=null)
  178.             NSHoverSel(1);
  179.         
  180.         if(mode==0) {
  181.             mc = mc.parentLayer.layers[mc.name.substr(0, mc.name.indexOf("EH"))];
  182.             n = CBparseInt(mc.name.substr(2));
  183.             if(nOM>1)
  184.                 if(mc==OpenMenus[nOM-1].SelCommand)
  185.                     return false;
  186.             while(!InMenu()&&nOM>1)
  187.                 Hide();
  188.             LayerHTM = hLayer[n];
  189.             OpenMenus[nOM].SelCommand = mc;
  190.             OpenMenus[nOM].SelCommandPar = mc.bgColor;
  191.             mc.bgColor = bcolor;
  192.         } else {
  193.             mc = (mode==1)?OpenMenus[nOM].SelCommand:OpenMenus[nOM].Opener;
  194.             bcolor = (mode==1)?OpenMenus[nOM].SelCommandPar:OpenMenus[nOM].OpenerPar;
  195.             n = CBparseInt(mc.name.substr(2));
  196.             LayerHTM = nLayer[n];
  197.             if(mc.parentLayer.background.src!="")
  198.                 mc.bgColor = null;
  199.             else
  200.                 mc.bgColor = bcolor;
  201.             window.status = "";
  202.             OpenMenus[nOM].SelCommand = null;
  203.         }
  204.         mc.clip.width = mc.parentLayer.parentLayer.clip.width - 2*mc.parentLayer.left;
  205.         mc.document.open();
  206.         mc.document.write(LayerHTM);
  207.         mc.document.close();
  208.  
  209.         return true;
  210.     }
  211.  
  212.     function Hide() {
  213. //IE,NS
  214. //This function hides the last opened group and it keeps hiding all the groups until
  215. //no more groups are opened or the mouse is over one of them.
  216. //Also takes care of reseting any highlighted commands.
  217. //------------------------------
  218. //Version 3.5
  219. //
  220.         window.clearTimeout(HTHnd[nOM]);HTHnd[nOM] = 0;
  221.         window.clearTimeout(AnimHnd);AnimHnd = 0;
  222.  
  223.         if(OpenMenus[nOM].SelCommand!=null) {
  224.             if(IE) HoverSel(1);
  225.             if(NS) NSHoverSel(1);
  226.         }
  227.         if(OpenMenus[nOM].Opener!=null) {
  228.             if(IE) HoverSel(3);
  229.             if(NS) NSHoverSel(3);
  230.         }
  231.  
  232.         OpenMenus[nOM].visibility = "hidden";
  233.         nOM--;
  234.  
  235.         if(nOM>0)
  236.             if(!InMenu())
  237.                 HTHnd[nOM] = window.setTimeout("Hide()", HideSpeed/4);
  238.  
  239.         if(nOM==0)
  240.             FormsTweak("visible");
  241.     }
  242.  
  243.     function ShowMenu(mName, x, y, isCascading) {
  244. //IE,NS
  245. //This is the main function to show the menus when a hotspot is triggered or a cascading command is activated.
  246. //------------------------------
  247. //mName: Name of the <div> or <layer> to be shown.
  248. //x: Left position of the menu.
  249. //y: Top position of the menu.
  250. //isCascading: True if the menu has been triggered from a command, and not from a hotspot.
  251. //------------------------------
  252. //Version 14.5
  253. //
  254.         window.clearTimeout(CBparseInt(HTHnd[nOM]));HTHnd[nOM] = 0;
  255.         x = CBparseInt(x);y = CBparseInt(y);
  256.         
  257.         if(AnimHnd && nOM>0) {
  258.             AnimStep=101;
  259.             Animate();
  260.         }
  261.         if(IE)
  262.             if(SM)
  263.                 var Menu = mFrame.document.getElementById(mName);
  264.             else
  265.                 var Menu = mFrame.document.all[mName];
  266.         if(NS)
  267.             var Menu = mFrame.document.layers[mName];
  268.         if(!Menu)
  269.             return false;
  270.         if(IE)
  271.             Menu = Menu.style;
  272.         if(Menu==OpenMenus[nOM])
  273.             return false;
  274.             
  275.         if(!isCascading)
  276.             HideAll();
  277.             
  278.         Menu.Opener = nOM>0?OpenMenus[nOM].SelCommand:null;
  279.         Menu.OpenerPar = nOM>0?OpenMenus[nOM].SelCommandPar:null;
  280.         Menu.SelCommand = null;
  281.         if(OP) {
  282.             Menu.width = Menu.pixelWidth;
  283.             Menu.height = Menu.pixelHeight;
  284.         }
  285.  
  286.         var pW = GetWidthHeight()[0] + GetLeftTop()[0];
  287.         var pH = GetWidthHeight()[1] + GetLeftTop()[1];
  288.         
  289.         if(IE) {
  290.             if(isCascading) {
  291.                 x = CBparseInt(OpenMenus[nOM].left) + CBparseInt(OpenMenus[nOM].width) - 6;
  292.                 y = y + CBparseInt(OpenMenus[nOM].top) - 5;
  293.                 Menu.left = (x+CBparseInt(Menu.width)>pW)?CBparseInt(OpenMenus[nOM].left) - CBparseInt(Menu.width) + 6:x;
  294.                 Menu.top =  (y+CBparseInt(Menu.height)>pH)?pH - CBparseInt(Menu.height):y;
  295.             } else {
  296.                 Menu.left = (x+CBparseInt(Menu.width)>pW)?pW - CBparseInt(Menu.width):x;
  297.                 Menu.top =  (y+CBparseInt(Menu.height)>pH)?pH - CBparseInt(Menu.height):y;
  298.             }
  299.             if(IsWin&&!SM)
  300.                 Menu.clip = "rect(0 0 0 0)";
  301.         }
  302.         if(NS) {
  303.             if(isCascading) {
  304.                 x = OpenMenus[nOM].left + OpenMenus[nOM].clip.width - 6;
  305.                 y = OpenMenus[nOM].top + OpenMenus[nOM].SelCommand.top;
  306.                 x = (x+Menu.w>pW)?OpenMenus[nOM].left - Menu.w + 6:x;
  307.                 y = (y+Menu.h>pH)?pH - Menu.h:y;
  308.             } else {
  309.                 x = (x+Menu.w>pW)?pW - Menu.w:x;
  310.                 y = (y+Menu.h>pH)?pH - Menu.h:y;
  311.             }
  312.             Menu.clip.width = 0;
  313.             Menu.clip.height = 0;
  314.             Menu.moveToAbsolute(x,y);
  315.         }
  316.         if(isCascading)
  317.             Menu.zIndex = CBparseInt(OpenMenus[nOM].zIndex) + 1;
  318.         Menu.visibility = "visible";
  319.         OpenMenus[++nOM] = Menu;
  320.         HTHnd[nOM] = 0;
  321.         if((IE&&IsWin&&!SM)||NS)
  322.             AnimHnd = window.setTimeout("Animate()", 10);
  323.         FormsTweak("hidden");
  324.  
  325.         return true;
  326.     }
  327.  
  328.     function Animate() {
  329. //IE,NS
  330. //This function is called by ShowMenu every time a new group must be displayed and produces the predefined unfolding effect.
  331. //Currently is disabled for Navigator, because of some weird bugs we found with the clip property of the layers.
  332. //------------------------------
  333. //Version 1.9
  334. //
  335.         var r = '';
  336.         var nw = nh = 0;
  337.         switch(fx) {
  338.             case 1:
  339.                 if(IE) r = "0 " + AnimStep + "% " + AnimStep + "% 0";
  340.                 if(NS) nw = AnimStep; nh = AnimStep;
  341.                 break;
  342.             case 2:
  343.                 if(IE) r = "0 100% " + AnimStep + "% 0";
  344.                 if(NS) nw = 100; nh = AnimStep;
  345.                 break;
  346.             case 3:
  347.                 if(IE) r = "0 " + AnimStep + "% 100% 0";
  348.                 if(NS) nw = AnimStep; nh = 100;
  349.                 break;
  350.             case 0:
  351.                 if(IE) r = "0 100% 100% 0";
  352.                 if(NS) nw = 100; nh = 100;
  353.                 break;
  354.         }
  355.         if(OpenMenus[nOM]) {
  356.             with(OpenMenus[nOM]) {
  357.                 if(IE)
  358.                     clip =  "rect(" + r + ")";
  359.                 if(NS) {
  360.                     clip.width = w*(nw/100);
  361.                     clip.height = h*(nh/100);
  362.                 }
  363.             }
  364.             AnimStep += 20;
  365.             if(AnimStep<=100)
  366.                 AnimHnd = window.setTimeout("Animate()",25);
  367.             else {
  368.                 window.clearTimeout(AnimHnd);
  369.                 AnimStep = 0;
  370.                 AnimHnd = 0;
  371.             }
  372.         }
  373.     }
  374.     
  375.     function InMenu() {
  376. //IE,NS
  377. //This function returns true if the mouse pointer is over the last opened menu.
  378. //------------------------------
  379. //Version 1.6
  380. //
  381.         var m = OpenMenus[nOM];
  382.         if(!m)
  383.             return false;
  384.         if(IE&&!SM)
  385.             SetPointerPos();            
  386.         var l = CBparseInt(m.left) + xOff;
  387.         var r = l+(IE?CBparseInt(m.width):m.clip.width) - xOff;
  388.         var t = CBparseInt(m.top) + xOff;
  389.         var b = t+(IE?CBparseInt(m.height):m.clip.height) - xOff;
  390.         return ((mX>=l && mX<=r) && (mY>=t && mY<=b));
  391.     }
  392.  
  393.     function SetPointerPos(e) {
  394. //IE,NS
  395. //This function sets the mX and mY variables with the current position of the mouse pointer.
  396. //------------------------------
  397. //e: Only used under Navigator, corresponds to the Event object.
  398. //------------------------------
  399. //Version 1.2
  400. //
  401.         if(IE) {
  402.             if(!SM) {
  403.                 if(mFrame!=cFrame||event==null)
  404.                     if(mFrame.window.event==null)
  405.                         return;
  406.                     else
  407.                         e = mFrame.window.event;
  408.                 else
  409.                     e = event;
  410.             }
  411.             mX = e.clientX + GetLeftTop()[0];
  412.             mY = e.clientY + GetLeftTop()[1];
  413.         }
  414.         if(NS) {
  415.             mX = e.pageX;
  416.             mY = e.pageY;
  417.         }
  418.     }
  419.     
  420.  
  421.     function HideMenus(e) {
  422. //IE,NS
  423. //This function checks if the mouse pointer is on a valid position and if the current menu should be kept visible.
  424. //The function is called every time the mouse pointer is moved over the document area.
  425. //------------------------------
  426. //e: Only used under Navigator, corresponds to the Event object.
  427. //------------------------------
  428. //Version 24.5
  429. //
  430.         if(nOM>0) {
  431.             SetPointerPos(e);
  432.             if(OpenMenus[nOM].SelCommand!=null)
  433.                 while(!InMenu() && !HTHnd[nOM]) {
  434.                     HTHnd[nOM] = window.setTimeout("Hide()", HideSpeed);
  435.                     if(nOM==0)
  436.                         break;
  437.                 }
  438.         }
  439.     }
  440.     
  441.     function FormsTweak(state) {
  442. //IE
  443. //This is an undocumented function, which can be used to hide every listbox (or combo) element on a page.
  444. //This can be useful if the menus will be displayed over an area where is a combo box, which is an element that cannot be placed behind the menus and it will always appear over the menus resulting in a very undesirable effect.
  445. //------------------------------
  446. //Version 2.0
  447. //
  448.         if(DoFormsTweak && IE)
  449.             for(var f = 0; f <= (mFrame.document.forms.length - 1); f++)
  450.                 for(var e = 0; e <= (mFrame.document.forms[f].elements.length - 1); e++)
  451.                     if(mFrame.document.forms[f].elements[e].type=="select-one")
  452.                         mFrame.document.forms[f].elements[e].style.visibility = state;
  453.     }
  454.  
  455.     function execURL(url, tframe) {
  456. //IE,NS
  457. //This function is called every time a command is triggered to jump to another page or execute some javascript code.
  458. //------------------------------
  459. //url: Encrypted URL that must be opened or executed.
  460. //tframe: If the url is a document location, tframe is the target frame where this document will be opened.
  461. //------------------------------
  462. //Version 1.1
  463. //
  464.         HideAll();
  465.         window.setTimeout("execURL2('" + url + "', '" + tframe + "')", 100);
  466.     }
  467.  
  468.     function execURL2(url, tframe) {
  469. //IE,NS
  470. //This function is called every time a command is triggered to jump to another page or execute some javascript code.
  471. //------------------------------
  472. //url: Encrypted URL that must be opened or executed.
  473. //tframe: If the url is a document location, tframe is the target frame where this document will be opened.
  474. //------------------------------
  475. //Version 1.1
  476. //
  477.         var fObj = eval(rStr(tframe));
  478.         url = rStr(url);
  479.         url.indexOf("javascript")!=url.indexOf("vbscript")?eval(url):fObj.location.href = url;
  480.     }
  481.  
  482.     function rStr(s) {
  483. //IE,NS
  484. //This function is used to decrypt the URL parameter from the triggered command.
  485. //------------------------------
  486. //Version 1.1
  487. //
  488.         s = xrep(s,"\x1E","'");
  489.         s = xrep(s,"\x1D","\x22");
  490.         s = xrep(s,"\x1C",",");
  491.         return s;
  492.     }
  493.  
  494.     function xrep(s, f, n) {
  495. //IE,NS
  496. //This function looks for any occurrence of the f string and replaces it with the n string.
  497. //------------------------------
  498. //Version 1.0
  499. //
  500.         var tmp = s.split(f);
  501.         return tmp.join(n);
  502.     }
  503.  
  504.     function hNSCClick(e) {
  505. //NS
  506. //This function executes the selected command's trigger code.
  507. //------------------------------
  508. //Version 1.0
  509. //
  510.         eval(this.TCode);
  511.     }
  512.     
  513.     function CBparseInt(n) {
  514. //IE,NS
  515. //This function fixes a bug in Navigator's parseInt() function for the Mac.
  516. //------------------------------
  517. //Version 1.3
  518. //
  519.         if(typeof(n)=="number"||typeof(n)=="string")
  520.             return (!IsWin&&!SM?n:parseInt(n))*1;
  521.         return 0;
  522.     }
  523.  
  524.     function HideAll() {
  525. //IE,NS
  526. //This function will hide all the currently opened menus.
  527. //------------------------------
  528. //Version 1.0
  529. //
  530.         while(nOM>0)
  531.             Hide();
  532.     }
  533.  
  534.     function GetLeftTop() {
  535. //IE,NS
  536. //This function returns the scroll bars position on the menus frame.
  537. //------------------------------
  538. //Version 2.0
  539. //
  540.         if(IE)
  541.             return [OP?0:SM?mFrame.scrollX:mFrame.document.body.scrollLeft,OP?0:SM?mFrame.scrollY:mFrame.document.body.scrollTop];
  542.         if(NS)
  543.             return [mFrame.pageXOffset,mFrame.pageYOffset];
  544.     }
  545.     
  546.     function tHideAll() {
  547. //IE,NS
  548. //This function is called when the mouse is moved away from a hotspot to close any opened menu.
  549. //------------------------------
  550. //Version 1.0
  551. //
  552.         HTHnd[nOM] = window.setTimeout("if(!InMenu()&&nOM==1)HideAll(); else HTHnd[nOM]=0;", HideSpeed);
  553.     }
  554.  
  555.     function GetWidthHeight() {
  556. //IE,NS
  557. //This function returns the width and height of the menus frame.
  558. //------------------------------
  559. //Version 2.0
  560. //
  561.         if(IE&&!SM)
  562.             return [mFrame.document.body.clientWidth,mFrame.document.body.clientHeight];
  563.         if(NS||SM)
  564.             return [mFrame.innerWidth,mFrame.innerHeight];
  565.     }
  566.     
  567.     function GetCStyle(cmc) {
  568. //IE,SM
  569. //This functions completes the style of command with all the common
  570. //parameters from the original style code.
  571. //------------------------------
  572. //Version 1.0
  573. //
  574.         return "position: absolute; left:" + cmc.left + 
  575.                "; top: " + cmc.top + 
  576.                "; width: " + (OP?cmc.pixelWidth:cmc.width) + 
  577.                "; height: " + (OP?cmc.pixelHeight:cmc.height) + "; ";
  578.     }
  579.     
  580.     function SetUpEvents() {
  581. //IE,NS
  582. //This function initializes the frame variables and setups the event handling.
  583. //------------------------------
  584. //Version 1.9
  585. //
  586.         onerror = errHandler;
  587.         if(typeof(mFrame)=="undefined")
  588.         mFrame = eval(frames['self']);
  589.         if(typeof(mFrame)=="undefined")
  590.             window.setTimeout("SetUpEvents()",10);
  591.         else {
  592.             if(NS) {
  593.                 mFrame.captureEvents(Event.MOUSEMOVE);
  594.                 mFrame.onmousemove = HideMenus;
  595.                 PrepareEvents();
  596.             }
  597.             if(IE) {
  598.                 document.onmousemove = HideMenus;
  599.                 mFrame.document.onmousemove = document.onmousemove;
  600.             }
  601.         }
  602.     }
  603.     
  604.     function errHandler(sMsg,sUrl,sLine) {
  605. //IE,NS
  606. //This function will trap any errors generated by the scripts and filter the unhandled ones.
  607. //------------------------------
  608. //Version 1.0
  609. //
  610.         if(sMsg.substr(0,16)!="Access is denied"&&sMsg!="Permission denied")
  611.             alert("DHTML Menu Builder Java Script Error\n" +
  612.                   "\nDescription: " + sMsg +
  613.                   "\nSource: " + sUrl +
  614.                   "\nLine: "+sLine);
  615.         return true;
  616.     }
  617.  
  618.     function PrepareEvents() {
  619. //NS
  620. //This function is called right after the menus are rendered.
  621. //It has been designed to attach the OnClick event to the <layer> tag. This is being
  622. //done this way because Navigator does not support a click inline event capturing on
  623. //the layer tag... duh!
  624. //------------------------------
  625. //Version 2.6
  626. //
  627.         for(var l=0; l<mFrame.document.layers.length; l++) {
  628.             var lo = mFrame.document.layers[l];
  629.             if(lo.layers.length) {
  630.                 lo.w = lo.clip.width;
  631.                 lo.h = lo.clip.height;
  632.                 for(var sl=0; sl<lo.layers[0].layers.length; sl++) {
  633.                     var slo = mFrame.document.layers[l].layers[0].layers[sl];
  634.                     if(slo.name.indexOf("EH")>0) {
  635.                         slo.document.onmouseup = hNSCClick;
  636.                         slo.document.TCode = nTCode[slo.name.split("EH")[1]];
  637.                     }                    
  638.                 }
  639.             }
  640.         }
  641.     }
  642.  
  643.     if(IE)
  644.         with(document) {
  645.             open();
  646.             write("<div id=\"linksmenu\" style=\"position: absolute; left:0; top:0; width: 85; height: 53; z-index: 100; visibility: hidden\"><div style=\"width: 85; height: 53; background-color: #004080; color: #000000; border-left: #FFFFFF solid 1; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF; border-bottom: 1 solid #000000;\"><div align=left style=\"position: absolute; border: 1px; ; left: 1; top: 1; width: 83; height: 15; font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #FFFFFF; cursor: hand; background-color: #004080;\" id=0 OnMouseOver=\"frames[\'self\'].HoverSel(0,\'_\',\'_\',this);window.status=\'Yahoo\';\" OnClick=\"frames[\'self\'].execURL(\'http://www.yahoo.com/\', \'frames[self]\');\"><span style=\"position: absolute; left: 0; top: 1; width: 81;\">Yahoo</span></div><div style=\"position: absolute; top: 18; left: 8; width: 69; height: 1; background-color: #000000;\"><font size=1></font></div><div align=left style=\"position: absolute; border: 1px; ; left: 1; top: 22; width: 83; height: 15; font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #FFFFFF; cursor: hand; background-color: #004080;\" id=1 OnMouseOver=\"frames[\'self\'].HoverSel(0,\'_\',\'_\',this);window.status=\'Home Page\';\" OnClick=\"frames[\'self\'].execURL(\'index.html\', \'frames[self]\');\"><span style=\"position: absolute; left: 0; top: 1; width: 81;\">Home Page</span></div><div align=left style=\"position: absolute; border: 1px; ; left: 1; top: 37; width: 83; height: 15; font-family: Tahoma; font-size: 8pt; font-weight: bold; font-style: none; color: #FFFFFF; cursor: hand; background-color: #004080;\" id=2 OnMouseOver=\"frames[\'self\'].HoverSel(0,\'_\',\'_\',this);window.status=\'Email Me\';\" OnClick=\"frames[\'self\'].execURL(\'mailto:prgsupport@xfx.net\', \'frames[self]\');\"><span style=\"position: absolute; left: 0; top: 1; width: 81;\">Email Me</span></div></div></div>");
  647.             close();
  648.         }
  649.     if(NS)
  650.         with(document) {
  651.             open();
  652.             write("<layer name=linksmenu top=0 left=0 width=85 height=53 z-index=100 bgColor=#FFFFFF visibility=hidden><layer bgColor=\"#004080\" left=1 top=1 width=83 height=51 z-index=101><layer name=MC1EH1 left=0 top=0 width=83 height=15 z-index=103 OnMouseOver=\"frames[\'self\'].NSHoverSel(0,this,\'#FFFFFF\');window.status=\'Yahoo\';\"></layer><layer name=MC1 left=0 top=0 width=83 height=15 z-index=102 bgcolor=#004080><p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Yahoo</font></b></layer><layer top=17 left=4 width=77 height=1 z-index=100 bgcolor=#000000></layer><layer name=MC3EH3 left=0 top=21 width=83 height=15 z-index=103 OnMouseOver=\"frames[\'self\'].NSHoverSel(0,this,\'#FFFFFF\');window.status=\'Home Page\';\"></layer><layer name=MC3 left=0 top=21 width=83 height=15 z-index=102 bgcolor=#004080><p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Home Page</font></b></layer><layer name=MC4EH4 left=0 top=36 width=83 height=15 z-index=103 OnMouseOver=\"frames[\'self\'].NSHoverSel(0,this,\'#FFFFFF\');window.status=\'Email Me\';\"></layer><layer name=MC4 left=0 top=36 width=83 height=15 z-index=102 bgcolor=#004080><p align=left><b><font face=Tahoma point-size=8 color=#FFFFFF>Email Me</font></b></layer></layer></layer>");
  653.             close();
  654.         }
  655. SetUpEvents();
  656.  
  657.  
  658.  
  659.